package com.ctbri.JWLetter.type.error;

import java.util.HashMap;
import java.util.Map;

import com.ctbri.JWLetter.type.base.ErrorType;

/**
 * 信件业务错误信息
 * 
 * @author Hogan
 *
 */
public enum LetterError implements ErrorType {

	/**
	 * 修改信件状态失败
	 */
	MODIFY_STATUS_FAILD(0x001, "修改信件状态失败!"),;

	private int id;
	private String description;

	LetterError(int id, String description) {
		this.id = id;
		this.description = description;
	}

	@Override
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Override
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	private static final Map<Integer, LetterError> DIRC = new HashMap<Integer, LetterError>();

	static {
		for (LetterError e : LetterError.values()) {
			DIRC.put(e.getId(), e);
		}
	}

	public static LetterError byId(int id) {
		return DIRC.get(id);
	}

}